@hieronim-bosch AppKit is my favorite framework, nothing else comes close. Until proven otherwise there is still no better way to make a Mac app IMHO.
That said I never got into Storyboards on Mac. In Xcode 26.2 I can still create an AppKit project the "old way" which is New Project -> macOS -> App then change Interface to XIB then you get a project without a storyboard.
If you want to go completely without Interface Builder you can but I don't think Apple ever had a template for that setup (well if they did I never noticed or it must have been a really long time ago).
You can set the NSApplication delegate in main.
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (strong) NSWindowController *mainWindowController;
@end
@implementation AppDelegate
-(void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
NSLog(@"Hello world!");
NSWindow *firstWindow = [[NSWindow alloc]initWithContentRect:NSMakeRect(50.0, 50.0, 400.0, 400.0) styleMask:NSWindowStyleMaskTitled backing:NSBackingStoreBuffered defer:NO];
firstWindow.title = @"Xibless";
self.mainWindowController = [[NSWindowController alloc]initWithWindow:firstWindow];
[self.mainWindowController showWindow:nil];
}
@end
// main.m
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSApplication *app = [NSApplication sharedApplication];
AppDelegate *appDelegate = [[AppDelegate alloc]init];
app.delegate = appDelegate;
[app setActivationPolicy:NSApplicationActivationPolicyRegular];
[app run];
}
}
and I think you also need to build the menu bar programmatically. IMO there really is no reason to do all this. If you want to avoid Interface Builder I think it's more reasonable to just do the following:
Create an Xib project.
Keep the MainMenu.xib but inside it delete the window but leave the menu bar.
Then in your AppDelegate just make your NSWindowController / NSWIndow in code. Then you're mostly without IB - enough for learning.
Or if you want you can build the menu bar (see mainMenu property on NSApplication: https://developer.apple.com/documentation/appkit/nsapplication/mainmenu?language=objc).
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: